package com.yss.sofa.report.engine.cell.invisible.dataset;

import java.io.Serializable;
import java.util.Map;
import java.util.Set;

import com.yss.sofa.report.engine.Const;
import com.yss.sofa.report.engine.Context;
import com.yss.sofa.report.engine.DataSet;
import com.yss.sofa.report.engine.DataSetData;
import com.yss.sofa.report.engine.cell.ReportCell;
import com.yss.sofa.report.engine.cell.invisible.InvisibleCell;


public class NoneDataSetCell extends InvisibleCell implements DataSet{
	//----------------------------------------------------------------------------------------------
	private class NoneDataSetData extends DataSetData{
		private static final long serialVersionUID = 2691691171192391154L;
		public NoneDataSetData(){
			super();
		}
		public int getCount(){
			return 0;
		}
		public int size(){
			return this.getCount();
		}
		public int getFieldCount(){
			return 0;
		}
		public String getValue(int index,CharSequence field){
			return null;
		}
		public String getField(int index){
			return null;
		}
		public Map<String,String> getRecord(int index){
			throw new IndexOutOfBoundsException("Index: "+index+", Size: 0");
		}
	}
	//----------------------------------------------------------------------------------------------
	private static final long serialVersionUID = 443346804554127145L;
	protected void init(){
		super.init();
		this.code=Const.NONE;
	}
	public void assignTo(ReportCell cell){
		NoneDataSetCell _=(NoneDataSetCell)cell;
		super.assignTo(_);
	}
	public NoneDataSetCell create(){
		NoneDataSetCell _=new NoneDataSetCell();
		this.assignTo(_);
		return _;
	}
	public Set<String> getParams() {
		return null;
	}

	public DataSetData execute(String classname,Context context, Map<String,Serializable> params,Map<String,String> consts) throws Exception {
		return new NoneDataSetData();
	}
	public String getCode() {
		return Const.NONE;
	}
	@Override
	public String getExec() {
		return "true";
	}
}
